#include "Matrix1.h"

#include <iostream>
#include <cmath>
#include <limits>
#include <vector>
using namespace std;

int main(int argc, char* argv[])
{
    int n = 0;
    cin >> n;

    /// Set the machine epsilon.
    const double eps = numeric_limits<double>::epsilon();

    SquareMatrix A(n);
    vector<double> b(n);
    vector<double> x(n);
    
    for (int i = 0; i < n; i++)
	for (int j = 0; j < n; j++)
	    cin >> A(i, j);
    for (int i = 0; i < n; i++)
	cin >> b[i];

    cout << n << endl;

    cout.setf(ios::fixed);
    cout.precision(20);
    for (int i = 0; i < n; i++)
    {
	for (int j = 0; j < n; j++)
	    cout << A(i, j) << "\t";
	cout << endl;
    }

    for (int i = 0; i < n; i++)
	cout << b[i] << "\t";
    cout << endl;

//    x = b / A;
    x = A.invMul(b);
    
    for (int i = 0; i < n; i++)
	cout << x[i] << "\t";
    cout << endl;
    
    return 0;
};
